package com.kehutong.auth.controller;


import com.kehutong.auth.entity.TestDemo;
import com.kehutong.auth.entity.User;
import com.kehutong.auth.service.TestService;
import com.kehutong.common.util.Token;
import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.json.annotation.JSONType;
import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;

@MvcAction
@ReqMapping("/test/demo")
public class TestAction {

    private static Logger logger = LoggerFactory.getLogger(TestAction.class);

    @Inject
    TestService testService;


    @ReqMapping("/listById")
    public Object listByRole(String id) {

        return testService.findTestData(id);
    }

    @ReqMapping("/addTest")
    public Object addTest(String name,Integer age) {

        logger.info("添加的數據信息：{},age:{}",name,age);

        return testService.addTestData();
    }

}
